home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10023 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: yama.mcc.ac.uk!usenet
  2. From: Simon Letherman <simon@ma.man.ac.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Help with writing floating points numbers to strings
  5. Date: 14 Mar 1996 23:18:33 GMT
  6. Organization: Sirius Cybernetics Corporation
  7. Message-ID: <4ia9g9$d1f@yama.mcc.ac.uk>
  8. NNTP-Posting-Host: radau.ma.man.ac.uk
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.12 (X11; I; SunOS 4.1.3 sun4c)
  13. X-URL: news:comp.lang.c
  14.  
  15. Hi.
  16.  
  17. I've got a fairly dozy problem, but since I'm new to C it's got the
  18. better of me.
  19.  
  20. I want to write output to a large string, which I can then get Mathematica
  21. to use to draw a graph. Unfortunately, this means that I've got to store
  22. floating point (actually double) variables in string format, and it
  23. really doesn't want to. I can usually get my code past the preprocessor,
  24. but when running anything like
  25.     sprintf(string, "%lf", &double);
  26. I get the core dumped on me.
  27.  
  28. Any ideas?
  29.  
  30. Thanks,
  31. Simon. 
  32. -- 
  33. Simon Letherman
  34. Department of Mathematics
  35. University of Manchester
  36. United Kingdom                    (simon@ma.man.ac.uk)
  37.  
  38.